﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace FCS.Test
{
    /// <summary>
    /// Summary description for IntListTest
    /// </summary>
    [TestClass]
    public class ListsTests : Functional
    {
        public ListsTests()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        [TestMethod]
        public void IntListTest()
        {
            Assert.IsTrue(Equals(ListFromArray(new int[]{1}), IntList(1, 1)));
            Assert.IsTrue(Equals(ListFromArray(new int[] { 1, 2, 3 }), IntList(1, 3)));
            Assert.IsTrue(IsEmpty(IntList(1, -3)));
            Assert.AreEqual(10, IntList(1, 10).Count());
            Assert.AreEqual(5, At(4, IntList(1, 10)));
        }

        [TestMethod]
        public void InfiniteIntListTest()
        {
            Assert.AreEqual(100001, At(100000, IntList(1)));
        }

        [TestMethod]
        public void EmptyListTest()
        {
            Assert.AreEqual(true, IsEmpty(Empty<string>()));
            Assert.AreEqual(true, Equals(Empty<string>(), Empty<string>()));
        }
    }
}
